<template>
  <div>
    <el-row :gutter="10">
      <el-col :span="10">
        <draggable v-model="list" :animation="340" group="people" @start="onDragStart" @end="onDragEnd">
          <template #item="{element}">
            <div class="list-element">{{element}}</div>
          </template>
        </draggable>
      </el-col>

      <el-col :span="10">
        <draggable v-model="list2" :animation="340" group="people" @start="onDragStart" @end="onDragEnd">
          <template #item="{element}">
            <div class="list-element2">{{element}}</div>
          </template>
        </draggable>
      </el-col>

      <el-col :span="2">
        list: {{list}}
      </el-col>

      <el-col :span="2">
        list2: {{list2}}
      </el-col>
    </el-row>

  </div>
</template>

<script>
import draggable from 'vuedraggable'

export default {
  components: {
    draggable
  },
  data(){
    return{
      list: ['Item 1', 'Item 2', 'Item 3'],
      list2: ['Item one', 'Item two', 'Item three']
    }
  },
  methods: {
    onDragStart(e){
      console.log('拖拽开始：',e)
    },
    onDragEnd(e){
      console.log('拖拽结束：',e)
    }
  }
}
</script>

<style scoped>
.list-element {
  padding: 10px;
  background: #eee;
  border: aquamarine solid 1px;
}
.list-element2 {
  padding: 10px;
  background: #999999;
  border: #027db4 solid 1px;
}
</style>